package org.moflon.moca;

import java.util.ArrayList;
import java.util.Map;

import java.util.HashMap;

/** please notice the following conventions:  
* i. The Path "org.moflon.moca" is fixed
* 	and name of this class is fixed and is name of the project + "Editor" 
* ii. Methods are public static and name of them and their outputs are fixed
*	and they don't have any input arguments
*/

public class VHDLCodeAdapterEditor { 
	public static Map<String, Integer[]> createKeywordColorMap() {
		Map<String, Integer[]> keywords = new HashMap<String, Integer[]>();

		Integer[] red = new Integer[]{255,0,0};
		Integer[] blue = new Integer[]{0,0,255};
		Integer[] green = new Integer[]{0,100,0};
		Integer[] pink = new Integer[]{255, 0, 255};
		  
		keywords.put("entity", red);
		keywords.put("architecture", red);
		keywords.put("of", red);
		keywords.put("port", red);
		keywords.put("map", red);
		keywords.put("is", red);
		keywords.put("begin", red);
		keywords.put("end", red);
		
		keywords.put("std_logic", blue);
		keywords.put("=>", blue);
		keywords.put("<=", blue);
		
		keywords.put("and", pink);
		keywords.put("or", pink);
		keywords.put("signal", pink);
		keywords.put("not", pink);
		
		keywords.put("in", green);
		keywords.put("out", green);
		keywords.put("struct", green);
		keywords.put("behv", green);
		
		
		return keywords;
	}

	public static String[] getTemplateNames() {
		// Here you give names to your templates, for example: 
		String[] templateNames = {
				"entity", 
				"behv",
				"struct",
				"in",
				"out",
				"signal",
				"mapping",
				"logic"
		};
		
		return templateNames;
	}

	public static String[] getTemplateDescriptions(){
		// Here you describe your templates, for example: 
		String[] templateDescriptions = {
				"Create a new entity",
				"Architecture of a primitive entity",
				"Architecture of a complex entity",
				"Create an in port",
				"Create an out port",
				"Create a signal",
				"Specify mapping of ports",
				"Specify logic expression"
		};
		
		return templateDescriptions;
	}

	public static String[] getTemplatePatterns() {
		// Here you can define the content of your template by using ${VAR} as variables, for example: 
		String[] templatePatterns = {
				"entity ${NAME} is\n" +
				"  port (\n" +
				"    \n" +
				"  );\n" +
				"end ${NAME} ;",
				
				"architecture behv of ${NAME} is\n" +
				"begin\n" +
				"\n" +
				"end behv ;",
				
				"architecture struct of ${NAME} is\n" +
				"\n" +
				"begin\n" +
				"\n" +
				"end struct ;",
				
				"${NAME}: in  std_logic ;",
				
				"${NAME}: out std_logic ;",
				
				"signal ${NAME}: std_logic ;",
				
				"${NAME} port map ( ) ;",
				
				"${OUT_PORT} <=  ;"
		};
		
		return templatePatterns;
	}

}